<?php


/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Education
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
 
 
?>
<?php if ($this->paginator->getTotalItemCount()): ?>
  
  <?php if ($this->display_style == 'narrow'): ?>
    <ul class="educations_list">
      <?php foreach ($this->paginator as $education): $user = $education->getOwner(); ?>
        <li>
          <?php if ($this->showphoto): ?>
          <div class="education_photo">
            <?php echo $this->htmlLink($education->getHref(), $this->itemPhoto($education, 'thumb.icon'));?>
          </div>
          <?php endif; ?>
          
          <div class="education_content">
            <div class="education_title"><?php echo $education->__toString()?></div>
            <?php if ($this->showdetails): ?>
              <div class="education_details">
                <div class="education_details_type">
                  <?php echo $this->htmlLink($education->getCategory()->getHref(), $this->translate($education->getCategory()->getTitle())); ?>
                  
                  <?php if ($education->class_year || $education->degree): ?>
                    <br />
                    <?php if ($education->degree): ?>
                      <?php echo $education->degree; ?>
                    <?php endif;?>
                    <?php if ($education->class_year): ?>
                      <?php echo $education->class_year; ?>
                    <?php endif;?>

                  <?php endif; ?>  
                </div>
                <?php if ($education->concentration || $education->minor): ?>
                <div class="education_details_focus">
                  <?php if ($education->concentration): ?>
                    <span class="education_concentration"><?php echo $this->translate('+ %s', $education->concentration); ?></span>
                  <?php endif;?>
                  <?php if ($education->minor): ?>
                    <span class="education_minor"><?php echo $this->translate('- %s', $education->minor); ?></span>
                  <?php endif;?>
                </div>
                <?php endif;?>
              </div>
            <?php endif; ?>
            <?php if ($this->showmeta): ?>
              <div class="education_meta">
                <?php echo $this->translate('By %s', $user->__toString()); ?>
                <br /><?php echo $this->timestamp(strtotime($education->creation_date)); ?>
                <?php if ($this->order == 'mostcommented'): ?>
                  -
                  <?php echo $this->translate(array("%s comment", "%s comments", $education->comment_count), $this->locale()->toNumber($education->comment_count)); ?>
                <?php elseif ($this->order == 'mostliked'): ?>
                  -
                  <?php echo $this->translate(array('%1$s like', '%1$s likes', $education->like_count), $this->locale()->toNumber($education->like_count)); ?>
                <?php elseif ($this->order == 'mostviewed'): ?>
                  -
                  <?php echo $this->translate(array('%s view', '%s views', $education->view_count), $this->locale()->toNumber($education->view_count)); ?>
                <?php endif;?>
              </div>
            <?php endif;?>
            <?php if ($this->showdescription && $education->getDescription()): ?>
              <div class="education_description">
                <?php echo $this->viewMore($education->getDescription()); ?>
              </div>
            <?php endif;?>
          </div>
        </li>  
      <?php endforeach; ?>
    </ul>

  <?php else: ?>
    <ul class="educations_entries">
    <?php foreach( $this->paginator as $education ): $user = $education->getOwner(); ?>
      <li>
        <?php if ($this->showphoto): ?>
        <div class="education_photo">
          <?php echo $this->htmlLink($education->getHref(), $this->itemPhoto($education, 'thumb.normal'));?>
        </div>
        <?php endif; ?>
        
        <div class="education_content">
          <div class="education_title"><h3><?php echo $education->__toString()?></h3></div>
          <?php if ($this->showdetails): ?>
            <div class="education_details">
              <div class="education_details_type">
                <?php echo $this->translate('School Type: %s', $this->htmlLink($education->getCategory()->getHref(), $this->translate($education->getCategory()->getTitle()))); ?>
                <?php if ($education->class_year): ?>
                  |
                  <?php echo $this->translate('Class: %s', $education->class_year); ?>
                <?php endif;?>
                <?php if ($education->degree): ?>
                  |
                  <?php echo $this->translate('Degree: %s', $education->degree); ?>
                <?php endif;?>
              </div>
              <?php if ($education->concentration || $education->minor): ?>
              <div class="education_details_focus">
                <?php if ($education->concentration): ?>
                  <span class="education_concentration"><?php echo $this->translate('Concentrate in %s', $education->concentration); ?></span>
                <?php endif;?>
                <?php if ($education->minor): ?>
                  <span class="education_minor"><?php echo $this->translate('with %s minor', $education->minor); ?></span>
                <?php endif;?>
              </div>
              <?php endif;?>
            </div>
          <?php endif; ?>
          <?php if ($this->showmeta): ?>
            <div class="education_meta">
              <?php echo $this->translate('Posted by %1$s on %2$s', $user->__toString(), $this->timestamp(strtotime($education->creation_date))) ?></span>
              -
              <?php echo $this->translate(array("%s comment", "%s comments", $education->comment_count), $this->locale()->toNumber($education->comment_count)); ?>
              -
              <?php echo $this->translate(array('%1$s like', '%1$s likes', $education->like_count), $this->locale()->toNumber($education->like_count)); ?>
              -
              <?php echo $this->translate(array('%s view', '%s views', $education->view_count), $this->locale()->toNumber($education->view_count)); ?>
            </div>
          <?php endif;?>
          <?php if ($this->showdescription && $education->getDescription()): ?>
            <div class="education_description">
              <?php echo $this->viewMore($education->getDescription()); ?>
            </div>
          <?php endif;?>
        </div>

      </li>
    <?php endforeach; ?>
    </ul>
  <?php endif;?>
<?php endif; ?>